import request from '@/utils/request'

// 获取用户信息
export function getStudentInformation() {
    return request({
        url: '/student/get-information',
        method: 'get'
    })
}

export function changeContactInformation(name, phone, email) {
    const data = {
        name,
        phone,
        email
    }
    return request({
        url: '/student/change-information',
        method: 'post',
        data: data
    })
}

export function acquirePaper() {
    return request({
        url: '/student/acquire-paper',
        method: 'get',
    })
}

export function acquirePatent() {
    return request({
        url: '/student/acquire-patent',
        method: 'get',
    })
}

export function acquireCompetition() {
    return request({
        url: '/student/acquire-competition',
        method: 'get',
    })
}

export function acquireSoftwareCopyright() {
    return request({
        url: '/student/acquire-software-copyright',
        method: 'get',
    })
}

export function acquireOther() {
    return request({
        url: '/student/acquire-other',
        method: 'get',
    })
}

export function submitPaper(paper) {
    return request({
        url: '/student/submit-paper',
        method: 'post',
        data: paper
    })
}

export function submitPatent(patent) {
    return request({
        url: '/student/submit-patent',
        method: 'post',
        data: patent
    })
}

export function submitCompetition(competition) {
    return request({
        url: '/student/submit-competition',
        method: 'post',
        data: competition
    })
}

export function submitSoftwareCopyright(softwareCompetition) {
    return request({
        url: '/student/submit-software-copyright',
        method: 'post',
        data: softwareCompetition
    })
}

export function submitOther(other) {
    return request({
        url: '/student/submit-other',
        method: 'post',
        data: other
    })
}


export function findPaperDetail(id) {
    return request({
        url: '/student/find-paper-detail/' + id,
        method: 'get'
    })
}

export function findPatentDetail(id) {
    return request({
        url: '/student/find-patent-detail/' + id,
        method: 'GET'
    })
}

export function findCompetitionDetail(id) {
    return request({
        url: '/student/find-competition-detail/' + id,
        method: 'GET'
    })
}

export function findSoftwareCopyrightDetail(id) {
    return request({
        url: '/student/find-software-copyright-detail/' + id,
        method: 'GET'
    })
}

export function findOtherDetail(id) {
    return request({
        url: '/student/find-other-detail/' + id,
        method: 'GET'
    })
}

export function removePaper(id) {
    return request({
        url: '/student/remove-paper/' + id,
        method: 'delete',
    })
}

export function removePatent(id) {
    return request({
        url: '/student/remove-patent/' + id,
        method: 'delete',
    })
}

export function removeCompetition(id) {
    return request({
        url: '/student/remove-competition/' + id,
        method: 'delete',
    })
}

export function removeSoftwareCopyright(id) {
    return request({
        url: '/student/remove-software-copyright/' + id,
        method: 'delete',
    })
}

export function removeOther(id) {
    return request({
        url: '/student/remove-other/' + id,
        method: 'delete',
    })
}

export function upload(uploadRequest) {
    return request({
        url: '/student/upload-file',
        method: 'post',
        data: uploadRequest
    })
}

export function download(downloadRequest) {
    return request({
        url: '/student/download-file',
        method: 'post',
        data: downloadRequest,
        responseType: 'blob' // 获取二进制响应数据
    })
}
